package com.anjie.powerproject.repository;

import com.anjie.powerproject.entity.PreStrategy;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface PreStrategyRepository extends JpaRepository<PreStrategy, Integer> {

    @Query(nativeQuery = true, value = "select * from pre_strategy where model_version = :model and start_time >= :start and end_time < :end and strategy_type= :strategyType")
    List<PreStrategy> getPreStrategy(@Param("model") Integer model, @Param("start") String start, @Param("end") String end, @Param("strategyType") Integer strategyType);
}
